/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.inter.service.inst;

import cn.simastudio.talos.inter.model.inst.Member;

import java.util.List;

/**
 * <p>Member: Zhang Kaitao
 * <p>Date: 14-1-28
 * <p>Version: 1.0
 */
public interface MemberService {

    /**
     * 创建用户
     *
     * @param member
     */
    Member createMember(Member member);

    Member updateMember(Member member);

    void deleteMember(Long memberId);

    /**
     * 修改密码
     *
     * @param memberId
     * @param newPassword
     */
    void changePassword(Long memberId, String newPassword);

    Member findOne(Long memberId);

    /**
     * 通过会员名查找会员信息，返回会员对象
     *
     * @param name 会员名
     * @return 会员对象Member
     */
    Member getMemberByName(String name);

    /**
     * 注册成员登录
     *
     * @param username 待登录的注册成员的用户名
     * @param password 待登录的注册会员的密码
     * @return 登陆成功的注册会员信息
     */
    Member login(String username, String password);

    List<Member> findAll();

    /**
     * 根据用户名查找用户
     *
     * @param membername
     * @return
     */
    Member findByMemberNameForAuth(String memberName);

    /**
     * 查询会员列表（姓名、id）
     *
     * @param member 会员对象Member
     * @return 会员对象列表
     */
    List<Member> getMemberList(Member member);

    /**
     * 重置密码
     *
     * @param tel 待重置密码member的tel
     * @return 重置密码的member
     */
    Member resetPassword(String tel);

    /**
     * 修改密码
     *
     * @param username    手机号码
     * @param oldPassword 旧密码
     * @param newPassword 新密码
     * @return 修改密码的Member
     */
    Member changePassword(String username, String oldPassword, String newPassword);
}
